<?php

class Control_Model_Form_Portfolio extends Zend_Form
{
    public function __construct($options = null)
    {
        parent::__construct($options);
        $this->setName('portfolio');
        $this->setAttrib('enctype', 'multipart/form-data');

        $id = new Zend_Form_Element_Hidden('id');
        $id->addFilter('Int');
        $logo = new Zend_Form_Element_File('logo');
        $logo->setLabel('Photo:')
                ->setDestination('images/user/original/')
                ->addValidator('Extension', TRUE, 'jpg,png,gif');

        $img1 = new Zend_Form_Element_File('img1');
        $img1->setLabel('The web-site photo №1:')
                ->setDestination('images/user/original/')
                ->addValidator('Extension', TRUE, 'jpg,png,gif');

        $img2 = new Zend_Form_Element_File('img2');
        $img2->setLabel('The web-site photo №2:')
                ->setDestination('images/user/original/')
                ->addValidator('Extension', TRUE, 'jpg,png,gif');

        $img3 = new Zend_Form_Element_File('img3');
        $img3->setLabel('The web-site photo №3:')
                ->setDestination('images/user/original/')
                ->addValidator('Extension', TRUE, 'jpg,png,gif');

//        $logo = new Zend_Form_Element_Text('logo');
//        $logo->setLabel('logo adress')
//                    ->setRequired(true)
//                    ->addFilter('StripTags')
//                    ->addFilter('StringTrim')
//                    ->addValidator('NotEmpty')
//                    ->setAttrib('size', 50);

        $logo_link = new Zend_Form_Element_Text('logo_link');
        $logo_link->setLabel('You tube video link (if class "Video"):')
                ->addFilter('StripTags')
                ->addFilter('StringTrim')
                ->setAttrib('size', 50);

        $name = new Zend_Form_Element_Text('name');
        $name->setLabel('Project name:')
            ->setRequired(true)
            ->addFilter('StripTags')
            ->addFilter('StringTrim')
            ->addValidator('NotEmpty')
            ->setAttrib('size', 50);

        $link = new Zend_Form_Element_Text('link');
        $link->setLabel('Link:')
            ->setRequired(true)
            ->addFilter('StripTags')
            ->addFilter('StringTrim')
            ->addValidator('NotEmpty')
            ->setAttrib('size', 50);

        $langs = new Zend_Form_Element_Text('langs');
        $langs->setLabel('Technic:')
            ->setRequired(true)
            ->addFilter('StripTags')
            ->addFilter('StringTrim')
            ->addValidator('NotEmpty')
            ->setAttrib('size', 50);

        $about = new Zend_Form_Element_Textarea('about');
        $about->setLabel('Case study:')
            ->setRequired(true)
            ->addFilter('StringTrim')
            ->addValidator('NotEmpty')
            ->setAttrib('class', 'elrte');

        $class = new Zend_Form_Element_Select('class');
        $class -> setLabel('Please select class:')
                ->setMultiOptions(array(
                    'Web'=>'Web',
                    'Logo'=>'Logo',
                    'Print'=>'Print',
                    'Video'=>'Video'
                    ));
        
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setAttrib('id', 'submitbutton');

        $this->addElements(array($id, $logo, $img1, $img2, $img3, $logo_link, $name, $link, $langs, $about, $class, $submit));
    }
}